<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Truncates file descriptor fd to offset bytes</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.dio-truncate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">dio_truncate</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5 &lt; 5.1.0)</p><p class="refpurpose"><span class="refname">dio_truncate</span> &mdash; <span class="dc-title">
   Truncates file descriptor fd to offset bytes 
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.dio-truncate-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>dio_truncate</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$fd</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span>
   ) : <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>dio_truncate()</strong></span> truncates a file to at most 
   <code class="parameter">offset</code> bytes in size.
  </p>
  <p class="para">
   If the file previously was larger than this size, the extra data is 
   lost. If the file previously was shorter, it is unspecified whether the
   file is left unchanged or is extended. In the latter case the extended 
   part reads as zero bytes.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.dio-truncate-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">fd</code></dt>

     <dd>

      <p class="para">
       The file descriptor returned by <span class="function"><a href="dio_open.html" class="function">dio_open()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">offset</code></dt>

     <dd>

      <p class="para">
       The offset in bytes.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.dio-truncate-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.dio-truncate-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">此函数未在 Windows 平台下实现。</span></p></blockquote>
 </div>

</div></div></div></body></html>